#ifndef _TOOL_H_
#define _TOOL_H_



#include "stdio.h"
#include "stdint.h"
#include "string.h"
uint16_t Get_Crc16(uint8_t* data, uint16_t  length);
int hex_to_str(char* sdata, uint8_t hdata);
void ef_set_env_int(const char* s, int a);
void ef_set_env(const char* s, const char* b);
const char* ef_get_env(const char* s);
int ef_get_env_int(const char* s);
int hexarr_to_strarr(char* sdata, uint8_t* hdata, uint16_t hlength);
uint16_t aep_str_check_sum(uint8_t* data, uint16_t len);
void strncpy(uint8_t* out, const char* in, int len);
void memcpy(uint8_t* out, uint8_t* in, int len);
void memcpy_2(uint8_t* out, uint8_t* in, int len);
uint16_t str_check_sum(uint8_t* data, uint16_t len);
uint16_t u8_2_u16(uint8_t* dat);
void str_to_hex(uint8_t* str, uint8_t* hex);
int strarr_to_hexarr(uint8_t* sdata, uint8_t* hdata, uint16_t str_len);
uint16_t aep_htons(uint16_t source);
uint32_t aep_htoni(uint32_t source);
uint32_t float_to_u32(float in);
float u32_to_float(uint32_t in);

uint16_t get_crc(uint8_t* pack, uint16_t length);
unsigned short CRC16_1(char* cp, unsigned short leng);
int str_search(const char* src, const char* dst, int num);
int mem_search(uint8_t* array, int array_len, char dst, int num);
void hexdump(const char* note, uint8_t* buf, int len);
#endif // !_TOOL_H_












